﻿@using NewLife.Web;
@{
    var page = ViewBag.Page as Pager;
    //page.PageUrlTemplate = page.PageUrlTemplate.Replace("{链接}", Url.Action("Index") + "{链接}");
    // 没有总记录数的时候不显示分页，可以认为不启用分页
}
@if (page.TotalCount > 0)
{<text>
        共<span>@page.TotalCount</span>条&nbsp;
        每页<span>@page.PageSize</span>条&nbsp;
        当前第<span>@page.PageIndex</span>页/共<span>@page.PageCount</span>页&nbsp;
        @Html.Raw(page.GetPage("首页"))&nbsp;
        @Html.Raw(page.GetPage("上一页"))&nbsp;
        @Html.Raw(page.GetPage("下一页"))&nbsp;
        @Html.Raw(page.GetPage("尾页")) &nbsp;
        转到第<input name="PageIndex" type="text" value="@page.PageIndex" class="input-sm" style="width:40px;text-align:right;" />页
        <input type="submit" name="PageJump" value="GO" class="btn btn-deafult btn-sm" />
        页大小
        <select id="PageSize" name="PageSize" onchange="$(':submit').click();">
            <option value="5">5</option>
            <option value="10">10</option>
            <option value="20">20</option>
            <option value="30">30</option>
            <option value="50">50</option>
            <option value="100">100</option>
        </select>
        <script type="text/javascript">
            $(function () {
                $('#PageSize').val(@page.PageSize);
            });
        </script>
</text>}